//package com.ornek.www.filter;
//
//import java.io.IOException;
//
//import javax.servlet.DispatcherType;
//import javax.servlet.Filter;
//import javax.servlet.FilterChain;
//import javax.servlet.FilterConfig;
//import javax.servlet.ServletException;
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//
///**
// * Servlet Filter implementation class LoginFilter
// */
//@WebFilter(dispatcherTypes = {
//				DispatcherType.REQUEST, 
//				DispatcherType.FORWARD, 
//				DispatcherType.INCLUDE, 
//				DispatcherType.ERROR
//		}
//					, urlPatterns = { "/*","/admin/*","/user/*","/Admin" })
//public class LoginFilter implements Filter {
//
//    /**
//     * Default constructor. 
//     */
//    public LoginFilter() {
//        // TODO Auto-generated constructor stub
//    }
//
//	/**
//	 * @see Filter#destroy()
//	 */
//	public void destroy() {
//		// TODO Auto-generated method stub
//	}
//
//	/**
//	 * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
//	 */
//	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
////		try {
////			HttpServletRequest req = (HttpServletRequest) request;
////			HttpServletResponse res = (HttpServletResponse) response;
////			HttpSession ses = req.getSession(false);
////			String reqURI = req.getRequestURI();
////			
////			if (reqURI.indexOf("/index.jsp") >= 0
////					|| reqURI.equals("/Countdown_Project_/")
////					|| reqURI.equals("/Countdown_Project_/Admin")
////					|| reqURI.indexOf("/anasayfa.jsp") >= 0
////					|| reqURI.indexOf("/countDown") >= 0 
////					|| reqURI.indexOf("/LoginServlet") >= 0 ||
////				(ses != null && ses.getAttribute("user") != null)){
//////				res.setHeader("Cache-Control", "private, no-store, no-cache, must-revalidate");
//////				res.setHeader("Pragma", "no-cache");
////				chain.doFilter(request, response);
////			}
////			else
////				res.sendRedirect(req.getContextPath() + "/countDown");
////		} catch (Throwable t) {
////			System.out.println(t.getMessage());
////		}
//	}
//
//	/**
//	 * @see Filter#init(FilterConfig)
//	 */
//	public void init(FilterConfig fConfig) throws ServletException {
//		// TODO Auto-generated method stub
//	}
//
//}
